package com.sjms._13_行为_模板方法;

public abstract class ACoffee {
    String select;
    String other = "无配料";
    boolean isOriginal;

    final void create() {
        this.select = select();
        cook();
        this.isOriginal = isOriginal();
        //
        if (!isOriginal) {
            this.other = other();
        }
        System.out.println("产出：" + select + " + " + other);
    }


    abstract boolean isOriginal();

    abstract String select();

    abstract String other();

    void cook() {
        System.out.println("开始煮咖啡：当前材料：" + this.select);
    }


}
